home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Examples / CExamples / DAEntry.a < prev    next >
Encoding:
Text File  |  1998-12-03  |  2.2 KB  |  68 lines  |  [TEXT/MPS ]

  1. ***************************************************************************
  2. ****    
  3. ****    DESK ACCESSORY and DEVICE DRIVER Entry Code/Data
  4. ****    
  5. ***************************************************************************
  6.  
  7.         STRING    PASCAL
  8.  
  9.         INCLUDE    'Events.a'    
  10.         INCLUDE 'Devices.a'
  11.         INCLUDE    'Traps.a'
  12.         INCLUDE 'Quickdraw.a'
  13.         
  14.         CASE OBJ
  15. **************************** DESK ACCESSORY ENTRY **************************
  16.         IMPORT %DRVRMain
  17.  
  18. DAEntry Proc Export                                    ; See Device Manager IM:2
  19. ;
  20. ; First we need to set the drvrFlags (IM II-188), choose from
  21. ;
  22. ;    dReadEnable        enable driver for read operations             (drivers only)
  23. ;    dWritEnable        enable driver for writing                     (drivers only)
  24. ;    dCtlEnable        enable driver/da for control operations        
  25. ;    dStatEnable        enable driver/da for status operations        (drivers only)
  26. ;    dNeedGoodBye    driver/da needs a "goodbye kiss"
  27. ;    dNeedTime        driver/da needs "main thread" time
  28. ;    dNeedLock        driver will be accessed at interrupt level    (drivers only)
  29. ;
  30.     DC.B        (1<<dCtlEnable) + (1<<dNeedTime)    ; periodic, control flags set
  31.     DC.B        0                                    ; Lower byte is unused
  32. ;
  33. ; Next is the the drvrDelay (IM II-188), set only if dNeedTime flag set above
  34. ;
  35.     DC.W        5*60                                ; 5 sec periodic update
  36. ;
  37. ; Next is the the drvrEMask (IM I-444), which events DA can respond to...
  38. ; Must be NIL for drivers, for DA's choose from
  39. ;    mButDwnEvt        mouse button down is event 1
  40. ;    keyDwnEvt        key down is event 3
  41. ;    keyUpEvt        key up is event 4
  42. ;    autoKeyEvt        auto-repeated key is event 5
  43. ;    updatEvt        update event
  44. ;    activateEvt        activate/deactive event
  45. ;
  46.     DC.W        (1<<updateEvt)                        ; Handle activate, update events
  47. ;
  48. ; Next is the the drvrMenu (IM I-444), Menu ID of DA's menu, or NIL
  49. ;
  50.     DC.W        0                                    ; No associated menu
  51. ;
  52. ; Next are the offsets to the main routines of the driver/DA
  53. ;
  54.     DC.W        %DRVRMain - DAEntry                    ; Open routine
  55.     DC.W        %DRVRMain - DAEntry +4                ; Prime - unused for DA's
  56.     DC.W        %DRVRMain - DAEntry +8                ; Control
  57.     DC.W        %DRVRMain - DAEntry +12                ; Status - unused for DA's
  58.     DC.W        %DRVRMain - DAEntry +16             ; Close
  59.  
  60. ;
  61. ; Next are the offsets to the main routines of the driver/DA
  62. ;
  63. DAName
  64.     DC.B        'Memory'                             ; DA/DRVR Name
  65.     ORG            DAName+32                            ; Pad string out to 32 bytes
  66.  
  67.     END
  68.